#!/bin/bash
MAIN_CLASS=cn.com.sealevel.main.Main
CUR_TIME=`date -u +%y%m%d%H%M%S`

bin=`dirname "${BASH_SOURCE-$0}"`
bin=`cd $bin; pwd`
PRJ_HOME=$bin

LOG_HOME=$PRJ_HOME/logs

if [ ! -d $LOG_HOME ]; then
    mkdir -p $LOG_HOME
fi

CLASSPATH=""
for f in $PRJ_HOME/lib/*.jar; do
    CLASSPATH=$CLASSPATH:$f
done

echo "----------------------start netty-mqtt-client -----------------------"

nohup java -Xmx8192M -Xms1024M -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$LOG_HOME/gc.out -classpath $CLASSPATH -Dlogging.home=$LOG_HOME $MAIN_CLASS $@ >> $LOG_HOME/run.out 2>&1 &
echo $! > netty-mqtt-client.pid
